﻿using System;
using System.Collections.Generic;
using Color = System.Drawing.Color;
using SwinGame;
using System.Diagnostics;

namespace RandomShapeGenerator.src
{
    public class Shape
    {
        private IShapeRenderer renderer = new RectangleRenderer();

        public IShapeRenderer Renderer
        {
            get { return renderer; }
            set { renderer = value; }
        }

        //shape
        protected float x, y;

        public float Y
        {
            get { return y; }
            set { y = value; }
        }

        public float X
        {
            get { return x; }
            set { x = value; }
        }

        protected int w, h;

        public int Height
        {
            get { return h; }
            set { h = value; }
        }

        public int Width
        {
            get { return w; }
            set { w = value; }
        }

        protected Color color;

        public Color Color
        {
            get { return color; }
            set { color = value; }
        }



        public void Draw()
        {
            Debug.WriteLine("ShapeList.");
            renderer.Draw(this);
        }
        public void Highlight()
        {
            renderer.Highlight(this);
        }

        public bool IsAt(float MousePosX, float MousePosY)
        {
            if ((MousePosX >= x) && (MousePosX <= (x + w)) && (MousePosY >= y) && (MousePosY <= (y + h)))
            {
                return true;
            }
            else
            {
                return false;
            }

        }


    }
}
